/*
 * @描述:
 * @作者: 约訂
 * @Date: 2024-06-25 13:20:33
 * @LastEditTime: 2024-09-06 10:41:11
 * @修改人员: 约訂
 */
import request from "@/utils/request";
/**获取单个账号详情 */
export function getUsers(id) {
  return request({
    url: "Users/GetDetail?id=" + id,
    method: "get",
  });
}
export function queryUsers(data) {
  return request({
    url: "Users/Query",
    method: "post",
    data,
  });
}
/**创建员工 */
export function createUser(data) {
  return request({
    url: "Users/Create",
    method: "post",
    data,
  });
}
/**更新用户基础信息 */
export function updateUser(data) {
  return request({
    url: "Users/Update",
    method: "post",
    data,
  });
}
/**获取用户权限 */
export function getUsersPower(id) {
  return request({
    url: "Users/GetUserPowerSplit?userID=" + id,
    method: "get",
  });
}
/**更新用户权限 */
export function editUsersPower(data) {
  return request({
    url: "Users/UpdateUserPower",
    method: "post",
    data,
  });
}
/**获取登录记录 */
export function logionRecording(data) {
  return request({
    url: "Users/GetLoginRecord",
    method: "post",
    data,
  });
}
/**获取操作记录 */
export function operateRecording(data) {
  return request({
    url: "Users/GetLog",
    method: "post",
    data,
  });
}
/**获取选择框用户列表 */
export function getSelectUserList(id = 1) {
  return request({
    url: "Users/GetUserOptions?enabled=" + id,
    method: "get",
  });
}
export function deleteUsers(data) {
  return request({
    url: "users/delete",
    method: "post",
    data,
  });
}

export function enableUsers(data) {
  return request({
    url: "users/enable",
    method: "post",
    data,
  });
}

export function resetPassword(data) {
  return request({
    url: "users/resetPassword",
    method: "post",
    data,
  });
}

export default {
  operateRecording,
  logionRecording,
  editUsersPower,
  getUsersPower,
  getUsers,
  createUser,
  updateUser,
  deleteUsers,
  queryUsers,
  enableUsers,
  resetPassword,
  getSelectUserList,
};
